package org.ruanjj.multithread.JUC;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicDemo {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(5);
        for (int i = 0; i < 20; i++) {
            new Thread(()->{
                System.out.println(atomicInteger.incrementAndGet());
            }).start();
        }
    }

}
